﻿/*-------------------------------------------------------------------------
* 命名空间: WaferSelectV3.Services/ConstantProvider
* 类       名: ConstantProvider
* 功      能:  TD
* 时      间:  2024/5/5 16:33:08
* 版      本:  V1.0
* 作      者:  Fioman
* 格      言:  Talk is cheap,show me the code ^_^
*-------------------------------------------------------------------------*/
using System.Collections.Generic;
using System.Linq;
using WaferSelectV3.Common;

namespace WaferSelectV3.Services
{
    public class ConstantProvider
    {
        static ConstantProvider()
        {
            SummaryTitle = SummaryTitle.Concat(CommanTitle).Concat(Title3D01).Concat(ResistivityTitle).Concat(SizeTitle).Concat(EdgeBreakFrontTitle).
                Concat(EdgeBreakBackTitle).Concat(EdgeBreakLeftTitle).Concat(EdgeBreakRightTitle).Concat(Title3D02).Concat(SmudgeUpTitle).
                Concat(SmudgeDownTitle).Concat(SubfissureTitle).ToList();
            LoggerHelper.WriteLogMain($"SummaryTitleLength = 96? {SummaryTitle.Count}", LogType.Test);
        }

        public static string DatabaseAddError = "数据库添加失败,context.SaveChanges() 返回值影响行数为0,添加操作出现异常!";

        public static string DatabaseUpdateError = "数据库更新失败,更新的影响的行数小于0,一般认为出错的时候是小于0";

        // 汇总的时候数据的标题(公共标题,各个工位的标题加一起,防止后续改动的时候改动地方太大)
        // 公共标题
        public static string[] CommanTitle = { "操作时间", "生产班次日期", "产品流水号", "切割编号", "晶棒编号", "位置编号", "批次号", "花篮号", "配方名称", "汇总等级", "等级类型", "类型描述", "入选料盒" };
        // 3D工位标题
        public static string[] Title3D01 = { "平均厚度", "TTV", "线痕最大值", "翘曲" };
        // 电阻率
        public static string[] ResistivityTitle = { "电阻率值", "电阻率最大值", "电阻率最小值" }; // 17, 18,19
        // 尺寸工位标题
        public static string[] SizeTitle = {"X边长最大值","X边长最小值","Y边长最大值","Y边长最小值","边长最大值","边长最小值","X边长","Y边长","对角线左上右下","对角线左下右上",
            "倒角最大值","倒角最小值","上下平行度","左右平行度","直角边最大值","直角边最小值","垂直度最大值","垂直度最小值","左上倒角","右上倒角","左下倒角",
            "右下倒角","左上角度","右上角度","左下角度","右下角度"};  // 20,21,22,23,24,25,26,27,28,29,30,31., 45
        // 崩边工位标题
        public static string[] EdgeBreakFrontTitle = { "前崩边有无", "前崩边数量", "前崩边面积" }; // 46 47 48

        public static string[] EdgeBreakBackTitle = { "后崩边有无", "后崩边数量", "后崩边面积" }; // 49 50 51

        public static string[] EdgeBreakLeftTitle = { "左崩边有无", "左崩边数量", "左表崩有无", "左表崩数量" }; // 52 53 54 55

        public static string[] EdgeBreakRightTitle = { "右崩边有无", "右崩边数量", "右表崩有无", "右表崩数量" }; // 56,57,58,59

        public static string[] Title3D02 = { "最小厚度", "最大厚度", "是否密集线痕", "上线痕数量", "上线痕数量最大值", "下线痕数量", "下线痕数量最大值", "线痕数量" }; // 60,61,62,63,64,65,66,67
        // 脏污工位标题
        public static string[] SmudgeUpTitle = { "上脏污有无", "上脏污面积", "上脏污数量", "上脏污是否反向", "上脏污缺口有无", "上脏污穿孔有无" }; // 68,69,70,71,72,73

        public static string[] SmudgeDownTitle = { "下脏污有无", "下脏污面积", "下脏污数量", "下脏污是否反向", "下脏污缺口有无", "下脏污穿孔有无" }; // 74,75,76,77,78,79

        // 隐裂工位标题
        public static string[] SubfissureTitle = { "隐裂1隐裂有无", "隐裂1隐裂面积", "隐裂1隐裂数量", "隐裂1崩边有无", "隐裂1崩边面积", "隐裂1崩边数量", "隐裂1孔洞有无", "隐裂1孔洞数量",
            "隐裂2隐裂有无", "隐裂2隐裂面积", "隐裂2隐裂数量", "隐裂2崩边有无", "隐裂2崩边面积", "隐裂2崩边数量", "隐裂2孔洞有无", "隐裂2孔洞数量" };
        // 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95.

        // 将所有的工位上的标题合并
        public static List<string> SummaryTitle = new List<string>();

        // 消息头和工位名称的映射
        public static Dictionary<string, string> MsgHeaderClientMap = new Dictionary<string, string>()
        {
             { "Size","尺寸"},{ "LeftEdge","左崩"},{"RightEdge","右崩"},{ "FrontEdge","前崩"},
            { "BackEdge","后崩"},{ "ThreeD","3D"},{"SmuDown","下脏污" },{ "SmuUp","上脏污"},
            {"Subfi","隐裂" },{"Napons","电阻率"}
        };
    }
}
